<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/3/20
 * Time: 10:34
 */

namespace App\Http\Traits;


use Illuminate\Http\Request;

trait AddressTrait
{
    use BaseTrait;

    // 验证秘钥
    protected $loginSession;
    // 地址ID
    protected $address_id;
    // 收货人
    protected $username;
    // 邮编
    protected $postalcode;
    // 省
    protected $province;
    // 市
    protected $city;
    // 区
    protected $district;
    // 详细地址
    protected $detail_info;
    // 国家码
    protected $nationalcode;
    // 联系方式
    protected $mobile;
    // 是否默认地址
    protected $is_default;

    public function __construct(Request $request)
    {
        $this->address_id = $request->input('address_id', 0);
        $this->loginSession = $request->input('loginSession', '');
        $this->username = $request->input('username', '');
        $this->postalcode = $request->input('postalcode', '');
        $this->province = $request->input('province', '');
        $this->city = $request->input('city', '');
        $this->district = $request->input('district', '');
        $this->detail_info = $request->input('detail_info', '');
        $this->nationalcode = $request->input('nationalcode', '');
        $this->mobile = $request->input('mobile', '');
        $this->is_default = $request->input('is_default', 0);
    }
}